/*
 * memory.c
 *
 *  Created on: Feb 25, 2012
 *  Author: user
 *
 *  For simulation purposes, value can be 0 - 100
 */

#include "memory.h"

int incrementMemValue (memory* mem, process* proc) {
	if (mem->value == 100) {
		proc->status = BLOCKED;
		return 1;
	}
	mem->value++;
	return 0;
}
int decrementMemValue (memory* mem, process* proc) {
	if (mem->value == 0) {
		proc->status = BLOCKED;
		return 1;
	}
	mem->value--;
	return 0;
}
